﻿using IBll;
using IDal;
using Model;

namespace Bll
{
    public class UserBll:IUserBll
    {
        private readonly IUserDal dal;

        public UserBll(IUserDal dal)
        {
            this.dal = dal;
        }
        /// <summary>
        /// 注册
        /// </summary>
        /// <param name="userInfo">用户表</param>
        /// <returns>返回受影响行数</returns>
        public int Add(UserInfo userInfo)
        {
            return dal.Add(userInfo);
        }
        /// <summary>
        /// 登录
        /// </summary>
        /// <param name="name">用户名</param>
        /// <param name="pwd">密码</param>
        /// <returns>通过用户名和密码查询返回相应的值</returns>
        public dynamic Login(string name, string pwd)
        {
            return dal.Login(name, pwd);
        }
        /// <summary>
        /// 显示
        /// </summary>
        /// <param name="name">姓名</param>
        /// <returns>通过登录人获取身份在获取信息</returns>
        public IQueryable<UserInfo> Show(string name = "")
        {
            return dal.Show(name);
        }
    }
}
